<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <title>Title</title>
</head>
<body>
<script>
    const map = new Map();
    const weakMap = new WeakMap();

    (function () {
      const foo = {a: 1}
      const bar = {b: 2}

      map.set(foo, 1)
      weakmap.set(bar, 2)
    })()

    console.log(map)
    console.log(weakmap)
    for (const key in map) {
      console.log(key)
    }
    for (const key in weakmap) {
      console.log(key)
    }
</script>
</body>
</html>
